﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using Xunit.Extensions;

namespace MetaSharp.Transformation.Grammar.Tests.TokenizerTests
{
    public class WhitespaceTests
    {
        [InlineData("\r\n")]
        [InlineData("\r")]
        [InlineData("\n")]
        [InlineData("\u0085")]
        [InlineData("\u2028")]
        [InlineData("\u2029")]
        [Theory]
        public void CanParseNewline(string newline)
        {
            var m = Pattern.Match(Tokenizer.NewLine, newline);
            Assert.True(m.Matched);
        }

        [InlineData(" ")]
        [InlineData("\u00A0")]
        [InlineData("\u1680")]
        [InlineData("\u2000")]
        [InlineData("\u2001")]
        [InlineData("\u2002")]
        [InlineData("\u2003")]
        [InlineData("\u2004")]
        [InlineData("\u2005")]
        [InlineData("\u2006")]
        [InlineData("\u2007")]
        [InlineData("\u2008")]
        [InlineData("\u2009")]
        [InlineData("\u200A")]
        [InlineData("\u202F")]
        [InlineData("\u205F")]
        [InlineData("\u3000")]
        [Theory]
        public void CanParseWhitespace(string Zs)
        {
            var m = Pattern.Match(Tokenizer.Whitespace, Zs);
            Assert.True(m.Matched);
        }
    }
}
